package com.xmzs.system.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.esotericsoftware.kryo.serializers.DefaultSerializers;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.xmzs.common.core.validate.AddGroup;
import com.xmzs.common.core.validate.EditGroup;
import com.xmzs.system.handler.CustomerBigDecimalSerialize;
import com.xmzs.web.domain.ChatMessage;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * 聊天消息视图对象 chat_message
 *
 * @author Lion Li
 * @date 2023-11-26
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ChatMessage.class)
public class ChatMessageVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelProperty(value = "主键")
    private Long id;

    /**
     * 用户ID
     */
    @NotBlank(message = "用户ID", groups = { AddGroup.class, EditGroup.class })
    private Long UserId;

    /**
     * 消息类型枚举
     */
    @ExcelProperty(value = "消息类型枚举")
    private Long messageType;

    /**
     * 聊天室 id
     */
    @ExcelProperty(value = "聊天室 id")
    private Long chatRoomId;

    /**
     * 对话 id
     */
    @ExcelProperty(value = "对话 id")
    private String conversationId;

    /**
     * 消息内容
     */
    @ExcelProperty(value = "消息内容")
    private String content;


    /**
     * 扣除费用
     */
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal deductCost;

    /**
     * 累计 Tokens
     */
    @ExcelProperty(value = "累计 Tokens")
    private Integer totalTokens;

    /**
     * 模型名称
     */
    @ExcelProperty(value = "模型名称")
    private String modelName;

    /**
     * 创建时间
     */
    private Date createTime;

}
